package com.comm;


public class R {
    
    private Integer code;
    private String msg;
    private Object data;
    private Integer count;
    public static R ok(Object... data){
        R r=new R();
        r.setCode(200);
        if (data.length>0){
           r.setData(data[0]);

        }
        r.setMsg("成功！");
        return r;
    }
    public static R defaulted(){
        R r=new R();
        r.setCode(500);
        r.setMsg("服务器开小差了！");
        return r;
    }

    public Integer getCode() {
        return code;
    }

    public R setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public R setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getData() {
        return data;
    }

    public R setData(Object data) {
        this.data = data;
        return this;
    }

    public Integer getCount() {
        return count;
    }

    public R setCount(Integer count) {
        this.count = count;
        return  this;
    }
}
